﻿    <script type="text/javascript">
        $(document).ready(function () {
            var ds = new datasource();
            var f = new childform();
            ds.c = "Way.Wx.Controllers.AccessToken";
            ds.notreload = true;
            ds.init();
            var tool = new toolstrip();
            tool.applyTo = 'menu';
            tool.datasource = ds;
            tool.issearch = false;
            tool.init();
            f.title = ds.modeldata.title;
            f.childitem = ds.modeldata.childitem;
            f.parent = ds;
            f.childfooter = ds.ischildfooter;
            f.fit = true;
            f.applyTo = "form";
            f.m = "add";
            f.init();
            $("#layout").layout();
            ds.onCommand = function (name, data) {
                ds.selectItem = f.val();
                return true;
            }
            ds.onSubmited = function (name, data, e) {
                if (name == "Region") {
                    f.findbox("remark").val(e.REMARK);
                }
            }
            var data = ds.load();
            if (data.total > 0) {
                f.val(data.rows[0]);
                //var grid = f.findgrid(0);
                //grid.clear();
                //grid.insertRow(data.tag);
            }
        });
     </script>
<div  border="false" class="easyui-layout" fit="true" id="layout">
<div border="true" region="north" style="height:30px;"><div id="menu"/></div>
<div border="false" region="center"><div id="form"/></div>
</div>
